package sqcon.sql;

//TODO finish this class
public class Sql implements SQLComparable{
	
	private SelectClause selectClause;
	private FromClause fromClause;
	private WhereClause whereClause;
	
	public Sql(){
		selectClause = null;
		fromClause = null;
		whereClause = null;
	}
	
	/**
	 * Construct an Sql object from a sql statement string
	 * @param sqlStr
	 */
	public Sql(String sqlStr){
		//TODO implement this constructor
	}
	
	public void setSelectClause(SelectClause selectClause){
		this.selectClause = selectClause;
	}
	
	public void setFromClause(FromClause fromClause){
		this.fromClause = fromClause;
	}
	
	public void setWhereClause(WhereClause whereClause){
		this.whereClause = whereClause;
	}
	
	public SelectClause getSelectClause(){
		return selectClause;
	}
	
	public FromClause getFromClause(){
		return fromClause;
	}
	
	@Override
	public String printString(){
		//TODO this is incomplete, missing group by and order by clause
		return selectClause.printString() + "\n"
			+ fromClause.printString() + "\n"
			+ whereClause.printString();
	}
	
	@Override
	public boolean isQuery(){
		return true;
	}
}
